//
//  TranslationAudioRUCell.swift
//  GLUZSwift
//
//  Created by xyanl on 2025/5/10.
//

import UIKit
import Reusable
import JKSwiftExtension

extension TranslationAudioRUCell: NibReusable {}

class TranslationAudioRUCell: BaseTableViewCell {
    
    @IBOutlet weak var iconImageView: UIImageView!
    /// 原文
    @IBOutlet weak var stringLabel: UILabel!
    /// 译文
    @IBOutlet weak var translationLabel: UILabel!
    
    weak var delegate: TranslationAudioCellDelegate?
    
    var model: TranslationAudioModel? {
        didSet {
            guard let model = model else { return }
            
            stringLabel.text = model.text
            translationLabel.text = model.translation
            
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
        backgroundColor = .clear
        contentView.backgroundColor = .clear
        
        iconImageView.jk.addShadow(shadowColor: UIColor(hex: "#D62A1E", 0.5), shadowOffset: CGSize(width: 0, height: 4), shadowOpacity: 0.58)
    }
    
    @IBAction func playAction(_ sender: Any) {
        guard let model = model else { return }
        delegate?.playContent(model: model)
    }
}
